/*
 * @Description:
 * @Date: 2022-11-07 12:00:27
 * @LastEditors: czp
 * @LastEditTime: 2023-04-03 11:59:09
 */
import "@/assets/font/font.scss";
import "@/assets/iconfont/iconfont.css";
import "nprogress/nprogress.css";
import { createPinia } from "pinia";
import piniaPersist from "pinia-plugin-persist";
import { createApp } from "vue";
import { changeSize } from "@/utils/rem";
import i18n from "./locales";
import App from "./App.vue";
import router from "./router";
import { useDebounceFn } from "@vueuse/core";
// 创建vue实例
const app = createApp(App);
// 全局错误处理
app.config.errorHandler = (err, instance, info) => {
	console.log("%c%s", "color:red", "#err错误对象:", err);
	console.log("%c%s", "color:blue", "#instance实例:", instance);
	console.log("%c%s", "color:green", "#info错误信息:", info);
};

// 配置国际化i18n
app.use(i18n);
// 挂载router
app.use(router);

// 挂载pinia
const pinia = createPinia();
pinia.use(piniaPersist);
app.use(pinia);
// 挂载自定义指令

app.mount("#app");

window.onresize = useDebounceFn(changeSize, 200);
